package com.yachtar.property.db;

import android.content.ContentValues;
import android.database.Cursor;

import java.io.Serializable;

/**
 * ��Ŀ��Ϣ��
 * 
 * @author Administrator
 * 
 */
public class TUseApply implements IBean, Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// �������ֶ���
	/**
	 * ��Ӧ����
	 */
	public final static String T_Name = "v_Fund_UseApply_ForVote";
	/**
	 * ��Ŀ���
	 */
	public final static String C_SERIALNO = "SERIALNO";
	/**
	 * ��Ŀ����
	 */
	public final static String C_DESCRIPTION = "DESCRIPTION";
	/**
	 * ����Ԥ��
	 */
	public final static String C_AMOUNTSUM = "AMOUNTSUM";
	/**
	 * �������
	 */
	public final static String C_AREA_SUM = "AREA_SUM";
	/**
	 * �漰����
	 */
	public final static String C_HOUSECOUNT = "HOUSECOUNT";
	/**
	 * ��Ŀ����
	 */
	public final static String C_REMARK = "REMARK";
	/**
	 * ����λ
	 */
	public final static String C_UNITNAME = "UNITNAME";

	// ����
	/**
	 * ��Ŀ���
	 */
	private String serialNo;
	/**
	 * ��Ŀ����
	 */
	private String description;
	/**
	 * ����Ԥ��
	 */
	private double amountSum;
	/**
	 * �������
	 */
	private double areaSum;
	/**
	 * �漰����
	 */
	private int houseCount;
	/**
	 * ��Ŀ����
	 */
	private String remark;
	/**
	 * ����λ
	 */
	private String unitName;
	
	public static final String[] tUseApplyCols = new String[] {
			TUseApply.C_AMOUNTSUM, TUseApply.C_AREA_SUM,
			TUseApply.C_DESCRIPTION, TUseApply.C_HOUSECOUNT,
			TUseApply.C_REMARK, TUseApply.C_SERIALNO, TUseApply.C_UNITNAME };

	public String getSerialNo() {
		return serialNo;
	}

	public void setSerialNo(String serialNo) {
		this.serialNo = serialNo;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public double getAmountSum() {
		return amountSum;
	}

	public void setAmountSum(double amountSum) {
		this.amountSum = amountSum;
	}

	public double getAreaSum() {
		return areaSum;
	}

	public void setAreaSum(double areaSum) {
		this.areaSum = areaSum;
	}

	public int getHouseCount() {
		return houseCount;
	}

	public void setHouseCount(int houseCount) {
		this.houseCount = houseCount;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public void loadData(Cursor c) {
		if (c != null && !c.isAfterLast()) {
			this.amountSum = c.getDouble(c.getColumnIndex(C_AMOUNTSUM));
			this.areaSum = c.getDouble(c.getColumnIndex(C_AREA_SUM));
			this.description = c.getString(c.getColumnIndex(C_DESCRIPTION));
			this.houseCount = c.getInt(c.getColumnIndex(C_HOUSECOUNT));
			this.remark = c.getString(c.getColumnIndex(C_REMARK));
			this.serialNo = c.getString(c.getColumnIndex(C_SERIALNO));
			this.unitName = c.getString(c.getColumnIndex(C_UNITNAME));
		}
	}

	public ContentValues createContentValues() {
		ContentValues values = new ContentValues();
		values.put(C_AMOUNTSUM, this.amountSum);
		values.put(C_AREA_SUM, this.areaSum);
		values.put(C_DESCRIPTION, this.description);
		values.put(C_HOUSECOUNT, this.houseCount);
		values.put(C_REMARK, this.remark);
		values.put(C_SERIALNO, this.serialNo);
		values.put(C_UNITNAME, this.unitName);
		return values;
	}

	@Override
	public void clearData() {
		// TODO Auto-generated method stub
		this.amountSum = 0;
		this.areaSum = 0;
		this.description = null;
		this.houseCount = 0;
		this.remark = null;
		this.serialNo = null;
		this.unitName = null;
	}

}
